Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack-cli throws an error on fresh new install on Docker/MacOS #30213

Closed
BrunoFenzl opened this issue May 7, 2024 · 3 comments · Fixed by #28402
Closed

webpack-cli throws an error on fresh new install on Docker/MacOS #30213

BrunoFenzl opened this issue May 7, 2024 · 3 comments · Fixed by #28402
Labels
bug Something isn't working status/to triage This issue needs to be triaged

Comments

@BrunoFenzl
Copy link

BrunoFenzl commented May 7, 2024

Steps to reproduce the problem

  1. Clone the repository on MacOS and follow the steps to get the Docker virtualization running
  2. Execute docker-compose -f .devcontainer/docker-compose.yml exec -w /workspaces/mastodon app .devcontainer/post-create.sh as described here to fix the issue in that link.

Expected behaviour

Webpack compilation should complete successfully

Actual behaviour

Webpack fails

Detailed description

Webpacker starts compiling the frontend assets and will stop with the following error: (excerpt)

...
[Webpacker] Everything's up-to-date. Nothing to do
[Webpacker] Everything's up-to-date. Nothing to do
[Webpacker] Everything's up-to-date. Nothing to do
[Webpacker] Everything's up-to-date. Nothing to do
[Webpacker] Everything's up-to-date. Nothing to do
  Rendered layout layouts/error.html.haml (Duration: 1529.2ms | Allocations: 582036)
Compiling...
Compilation failed:
/workspaces/mastodon/node_modules/webpack-cli/bin/cli.js:93
                                throw err;
                                ^

TypeError: Cannot read properties of undefined (reading 'compress')
    at Object.<anonymous> (/workspaces/mastodon/config/webpack/development.js:32:35)
    at Module._compile (/workspaces/mastodon/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (/workspaces/mastodon/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at WEBPACK_OPTIONS (/workspaces/mastodon/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
    at requireConfig (/workspaces/mastodon/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
    at /workspaces/mastodon/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
    at Array.forEach (<anonymous>)
    at module.exports (/workspaces/mastodon/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
    at /workspaces/mastodon/node_modules/webpack-cli/bin/cli.js:71:45
    at Object.parse (/workspaces/mastodon/node_modules/yargs/yargs.js:576:18)
    at /workspaces/mastodon/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/workspaces/mastodon/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/workspaces/mastodon/node_modules/webpack/bin/webpack.js:156:2)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.12.2

It seems to me that the configuration in config/webpacker.yml is not being read. Anyone facing this error?
Thanks in advance!

Mastodon instance

No response

Mastodon version

No response

Technical details

If this is happening on your own Mastodon server, please fill out those:

  • Ruby version: v3.2.4
  • Node.js version: v20.12.2
  • MacOS 14.4.1 on Apple Silicon M3
  • Docker version 25.0.3
@BrunoFenzl
Copy link
Author

How are developers on newer macs supposed to develop? As of now, Vagrant virtualization does not work with Virtualbox and Docker is broken. Installing the setup on bare metal is not an option at work.
Any hints or some guidance are greatly appreciated! Thanks in advance!

@daudix
Copy link
Contributor

daudix commented May 15, 2024

It's also an issue on Linux, not just macOS

@BrunoFenzl
Copy link
Author

Thanks for the fix @renchap! I can confirm it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status/to triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants